home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / scherz programme / clicker / source / gui.h < prev    next >
C/C++ Source or Header  |  1996-04-07  |  2KB  |  64 lines

  1. /*  File:         gui.h
  2.  *  Created:      20-10-95
  3.  *  Updated:      30-12-95
  4.  *  Version:      1.0
  5.  *  Project:      Clicker
  6.  *  Owner:        Jeroen Vermeulen
  7.  *  Requirements: KickStart V39+
  8.  *  Legal:        PD
  9.  *  Status:       Release
  10.  */
  11.  
  12. /* Enumeration type for our prefs window gadgets:
  13.  */
  14. enum { mygadget_clickmouse, mygadget_volume, mygadget_period, mygadget_cycles };
  15.  
  16.  
  17. /* Struct WindowContext:
  18.  * Contains all state associated with the prefs window.  This is used as a
  19.  * handle for keeping track of all window data and passing it around.
  20.  * NOTE:  Any item can change if the window is opened or closed.
  21.  * NOTE:  Items not marked "SAFE" may not even be valid.
  22.  */
  23. struct WindowContext
  24. {
  25.   BOOL           Shown;         /* Window is currently visible?         VALID */
  26.   ULONG          SigMask;       /* IDCMP-port sig mask for window.      VALID */
  27.   struct Window *Win;           /* Window struct.                             */
  28.   struct Gadget *glist;         /* GadTools gadget list                       */
  29.   void          *visinfo;       /* VisualInfo.                                */
  30.   struct Screen *pubscr;        /* Current screen.                      VALID */
  31. };
  32.  
  33.  
  34. /* MakeWindow():
  35.  * Sets up the prefs window, but doesn't show it unless the Show argument is
  36.  * TRUE.  If successful, MakeWindow() returns a pointer to a WindowContext
  37.  * structure.  If not, NULL is returned and the STRPTR pointed to by errptr will
  38.  * point to an error string.
  39.  * The window must later be deallocated with DestroyWindow().
  40.  */
  41. struct WindowContext *MakeWindow(STRPTR *const errptr, const BOOL Show);
  42.  
  43.  
  44. /* ShowWindow():
  45.  * Reveal prefs window, setting it up first if necessary.  A non-NULL pointer to
  46.  * its WindowContext structure is passed in as an argument.
  47.  * If the window fails to open, errptr will point to an error string.
  48.  */
  49. void ShowWindow(STRPTR *const errptr, struct WindowContext *const WinStruct);
  50.  
  51.  
  52. /* HideWindow():
  53.  * Removes the prefs window from the screen, but may keep its structures around
  54.  * for speed and convenience.
  55.  */
  56. void HideWindow(struct WindowContext *const WinStruct);
  57.  
  58.  
  59. /* DestroyWindow():
  60.  * Call this to deallocate the prefs window.  It will be closed first if
  61.  * necessary.
  62.  */
  63. void DestroyWindow(struct WindowContext *const WinStruct);
  64.